﻿/*文件注释
 * ===============================================================================
 * 说明：
 * 作者：曾永佑
 * 版本：V1.0
 * 创建日期：2013-02-10
 * 完成日期： 
 * 修改纪录：  
 * ===============================================================================
 */  
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SRF.Data.Impl
{
    public class MySqlDatabase : Database
    {
        public MySqlDatabase(string connectionString)
            : base(connectionString, MySql.Data.MySqlClient.MySqlClientFactory.Instance)
        {

        }

        public override string BuildPageSql(string sql, int startRow, int? maxRows, string orderBy = "")
        {
            sql += string.Format(" limit {0},{1}", startRow - 1, maxRows == null ? -1 : maxRows.Value);

            return sql;
        }

        public override char ParameterToken
        {
            get { return ':'; }
        }
        public override char OpenQuote
        {
            get
            {
                return '`';
            }
        }
        public override char CloseQuote
        {
            get
            {
                return '`';
            }
        }
    }
}